class Animal {

  /**
  * 构造函数
  */
  constructor(public name: string) {
  }

  move(distanceInMeters: number = 0) {
    console.log(`The ${this.name} moved ${distanceInMeters}m.`);
  }
}

let dog = new Animal('dog');

console.log(dog.name);
dog.move(15);